<!DOCTYPE html>
<html lang="en">
	<head>
    	<meta name="layout" content="main_pc">
        <title>火堆工作台</title>       
        <link rel="stylesheet" href="${resource(dir: 'css', file: 'user.center.css')}" type="text/css">
    </head>
<body>

	<div class="container-fluid">

		<section class="quick-navi mb20">
			<div class="container">
				<a href="#" class="quick-link"><span>火堆工作台</span><span
					class="caret"></span></a>
				<!--a href="#" class="quick-link">联系我们</a-->
			</div>
		</section>

		<section>
			<div class="container mb50">
				
				<g:render template="navigate"   model="[status: status]"/>				
				
				
				<div class="right-content" id="rightconsole">
				
					<g:if test="${status=='wait'}">
						<div class="data-list-box">
                           <div class="title"></div>
                           <ul class="cdsp-table">
                               <li class="t-head">
                                  <div class="col-1"></div>
                                   <div class="col-2">用户真实姓名</div>
                                   <div class="col-4">身份证号</div>
                                   <div class="col-3">创建时间</div>	                                   
								   <div class="col-6">操作</div>
                                   <div class="clearboth"></div>
                               </li>
                                
                               <g:each in="${users}" var="${user}" status="i">
                               	<li>
                               		<div class="col-1">
                                        <div class="title">${i+1}</div>
                                    </div>
                                     <div class="col-2">
                                        <div class="title">${user.realName}</div>
                                    </div>
                                    <div class="col-4">
                                        <div class="text">${user.idNumber}</div>
                                    </div>
                                    <div class="col-3">
                                        <div class="text">
                                        <g:formatDate format="yyyy-MM-dd" date="${user.createTime}"/>
                                        </div>
                                    </div>	                                   	                                    
                                    <div class="col-6">
                                    	<g:link action="showInfo" params='[userid:"${user.id}"]' target='_blank'><div class="btn btn-check btn-white" data-dialog="dialog1">查看</div></g:link>
                                        <a href="#" data-toggle="modal" data-target="#alert_pass" onclick="pass('${user.id}')" ><div class="btn btn-check btn-white" data-dialog="dialog1">通过</div></a>
                                        <a href="#" data-toggle="modal" data-target="#alert_refuse" onclick="refuse('${user.id}')" ><div class="btn btn-check btn-white">拒绝</div></a>
                                    </div>
                                    <div class="clearboth"></div>
                               	</li>
                               </g:each>
                           </ul>
                       </div>
					</g:if>
					
					<g:if test="${status=='pass'}">
						<div class="data-list-box">
                           <div class="title"></div>
                           <ul class="cdsp-table">
                               <li class="t-head">
                                  <div class="col-1"></div>
                                   <div class="col-2">用户真实姓名</div>
                                   <div class="col-4">身份证号</div>
                                   <div class="col-3">创建时间</div>	                                   
								   <div class="col-6">操作</div>
                                   <div class="clearboth"></div>
                               </li>
                                
                               <g:each in="${users}" var="${user}" status="i">
                               	<li>
                               		<div class="col-1">
                                        <div class="title">${i+1}</div>
                                    </div>
                                     <div class="col-2">
                                        <div class="title">${user.realName}</div>
                                    </div>
                                    <div class="col-4">
                                        <div class="text">${user.idNumber}</div>
                                    </div>
                                    <div class="col-3">
                                        <div class="text">
                                        <g:formatDate format="yyyy-MM-dd" date="${user.createTime}"/>
                                        </div>
                                    </div>	                                   	                                    
                                    <div class="col-6">
                                    	<g:link action="showInfo" params='[userid:"${user.id}"]' target='_blank'><div class="btn btn-check btn-white" data-dialog="dialog1">查看</div></g:link>
                                        <a href="#" data-toggle="modal" data-target="#alert_refuse" onclick="refuse('${user.id}')" ><div class="btn btn-check btn-white">修改</div></a>
                                    </div>
                                    <div class="clearboth"></div>
                               	</li>
                               </g:each>
                           </ul>
                       </div>
					</g:if>
					
					<g:if test="${status=='refuse'}">
						<div class="data-list-box">
                           <div class="title"></div>
                           <ul class="cdsp-table">
                               <li class="t-head">
                                  <div class="col-1"></div>
                                   <div class="col-2">用户真实姓名</div>
                                   <div class="col-4">身份证号</div>
                                   <div class="col-3">创建时间</div>	                                   
								   <div class="col-6">操作</div>
                                   <div class="clearboth"></div>
                               </li>
                                
                               <g:each in="${users}" var="${user}" status="i">
                               	<li>
                               		<div class="col-1">
                                        <div class="title">${i+1}</div>
                                    </div>
                                     <div class="col-2">
                                        <div class="title">${user.realName}</div>
                                    </div>
                                    <div class="col-4">
                                        <div class="text">${user.idNumber}</div>
                                    </div>
                                    <div class="col-3">
                                        <div class="text">
                                        <g:formatDate format="yyyy-MM-dd" date="${user.createTime}"/>
                                        </div>
                                    </div>	                                   	                                    
                                    <div class="col-6">
                                    	<g:link action="showInfo" params='[userid:"${user.id}"]' target='_blank'><div class="btn btn-check btn-white" data-dialog="dialog1">查看</div></g:link>
                                        <a href="#" data-toggle="modal" data-target="#alert_pass" onclick="pass('${user.id}')" ><div class="btn btn-check btn-white" data-dialog="dialog1">修改</div></a>
                                    </div>
                                    <div class="clearboth"></div>
                               	</li>
                               </g:each>
                           </ul>
                       </div>
					</g:if>
				                   
                              
                        
                    <div class="pagea">
		               <span>共${totalCount ?: 0}条记录</span>
		               <div class="page float_r" style="margin: 10px;padding: 10px;border:5px;">
					   <g:paginate controller="manage" action="userApproveStatus" params='[status:"${status}"]' total="${totalCount ?: 0}"/>
					   </div>
		          	</div>                            
            	</div>
                	
                	
			</div>
			<div class="clearboth"></div>
		</section>


	</div>

<!-- 审批通过弹出框 -->
		<div class="modal fade" id="alert_pass">
			<div class="modal-dialog" style='margin-top:200px;'>
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title">提示</h4>
				</div>
				
				<div class="modal-body">
					<font size='5px'>
						<p>确定审批通过吗？</p>
					</font>
				</div>
				
				<div class="modal-footer" style="text-align:left">
					<a href="#" class="btn btn-primary" id='data_pass'>通过</a>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
				
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
<!-- 审批拒绝弹出框 -->		
		<div class="modal fade" id="alert_refuse">
			<div class="modal-dialog" style='margin-top:200px;'>
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title">提示</h4>
				</div>
				
				<div class="modal-body">
					<font size='5px'>
						<p>确定审批拒绝吗？</p>
					</font>
				</div>
				
				<div class="modal-footer" style="text-align:left">
					<a href="#" class="btn btn-primary" id='data_refuse'>拒绝</a>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
				
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->


	<script type="text/javascript">
		$(function() {
			$('ul.nav.navbar-nav li').hover(
			function() {
				console.log($(this).index());
				$(this).siblings('.top-active').addClass(
						'position-' + $(this).index());
			},
			function() {
				$(this).siblings('.top-active').removeClass(
						'position-' + $(this).index());
			});
		})
		function pass(id){
			var data_pass = $("#data_pass");
			data_pass.attr("href","/scfire/manage/userApprove?userid="+id+"&opt=pass");
        }
		function refuse(id){
			var data_refuse = $("#data_refuse");
			data_refuse.attr("href","/scfire/manage/userApprove?userid="+id+"&opt=refuse");
        }
	</script>

</body>
</html>